package main.iterator;

public class Main {

    public static void main(String[] args) {

	Menu1 menu1 = new Menu1();
	MyIterator mi1 = menu1.getIterator();
	while (mi1.hasNext()) {
	    MenuItem mi = mi1.next();
	    System.out.println(mi.getName());
	}

	Menu2 menu2 = new Menu2();
	MyIterator mi2 = menu2.getIterator();
	while (mi2.hasNext()) {
	    MenuItem mi = mi2.next();
	    System.out.println(mi.getName());
	}
    }

}
